/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.makimo.fuzzy.sets.memberships;


/**
 *
 * @author Mateusz Papiernik
 */
public class GaussianMembershipFunction extends ContinuousMembershipFunction {
	public double u;
	public double sigma;
	
    public GaussianMembershipFunction(double u, double sigma) {
		super();
		this.u = sigma;
		this.sigma = sigma;
	}

	public Object value(Object obj) {
		double x = (Double)obj;
		
		return Math.exp(-0.5 * Math.pow(((x - 0)/sigma), 2));
    }
}
